export const transformArrayIntoObject = <TArray, TKey extends string = 'title'>(
  array: TArray[],
  key: TKey = 'title' as TKey,
): Array<{ id: number } & Record<TKey, TArray>> =>
  array.map((value, index) => ({ id: index + 1, [key]: value } as { id: number } & Record<TKey, TArray>));

export const makeMockArray = (length: number, fill = 1) => transformArrayIntoObject(Array.from({ length }).fill(fill));
